<!doctype html>
<html>
<head>

  <title>dom-if</title>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <script src="../../../webcomponentsjs/webcomponents-lite.js"></script>
  <link rel="import" href="../../polymer.html">

</head>
<body>

  <dom-module id='inner-component'>
    <template>
      <p>inner_before</p>
      <template is=dom-if if={{!value}} restamp>
        <content></content>
      </template>
      <p>inner_after</p>
    </template>
    <script>
      Polymer({
        is:'inner-component',
        properties: {
          attr: String,
          value: { type: Boolean, computed: 'computeValue(attr)' },
        },
        computeValue: function(str) { 
          return str ? true:false;
        }      
      });
    </script>
  </dom-module>

  <dom-module id='outer-component'>
    <template>
      <inner-component id="inner" attr="hi">
        <template is=dom-if if={{outerValue}}>
           template
        </template>
        <p>outer_after</p>
      </inner-component>
    </template>
    <script>
      Polymer({
        is:'outer-component',
        properties: {
          attr: String,
          outerValue: { type: Boolean, computed: 'computeOuterValue(attr)' },
        },
        computeOuterValue: function(str) { 
          return str ? true:false;
        }
      });
    </script>
  </dom-module>
  
  <outer-component attr='hi'></outer-component>

</body>
</html>
